import java.util.Date;
import java.util.GregorianCalendar;
/**
 * This class ...
 */

public class Holiday
{

   public int status;//0=new, 1=accepted, 2=denied;
   public Date start, end;
   public int driverHoliday;

   public  Holiday(Date startDate, Date endDate, int driverID)
   {
    if (startDate == null) throw new InvalidQueryException("Date is null");

   start =startDate;
   end = endDate;
   driverHoliday = driverID;
   status = 0;
   }//constructor

   public  boolean reqHoliday()
   {
       if(DriverInfo.getHolidaysTaken(driverHoliday)>25 )return false;
        return true;
   }//reqHoliday

   public void updateDatabase()
   {
             long diff = (end.getTime()-start.getTime())/(1000 * 60 * 60 * 24);
      DriverInfo.setHolidaysTaken(driverHoliday, (int)diff); 
      System.out.println("diferenta: "+ diff);
   }
}//Holiday
